<div style="position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; overflow-y: auto;">

    <div class="userinfo">
        <div class="icon"><img src="images/avatar.png" height="76px"/></div>
        <div class="userdetail">
            欢迎您！&nbsp;&nbsp;<span class="name">--</span> <br/>
            <span class="line2">
                账户余额：<span class="red"> 0.00 </span>RMB
                <a href="#"><img src="images/icon-refresh.png" style="width:20px;"></a>
            </span>
        </div>
        <div class="clear"></div>
    </div>

    <div class="profile-list">
        <div class="item">
            <div class="t">账号：</div>
            <div class="v uid"></div>
            <div class="clear"></div>
        </div>
        <div class="item">
            <div class="t">真实姓名：</div>
            <div class="v realname"></div>
            <div class="clear"></div>
        </div>
        <div class="item">
            <div class="t">币别：</div>
            <div class="v">RMB</div>
            <div class="clear"></div>
        </div>
    </div>
</div>
<style type="text/css">
    .userinfo {
        height: 115px;
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
        font-size: 14px;
    }
    .userinfo .icon {
        float: left;
        width: 120px;
        text-align: center;
        padding-top: 20px;
    }
    .userinfo .userdetail {
        float: left;
        margin-left: 0px;
        margin-top: 30px;
        color: #f0ecec;
        font-size: 16px;
        font-weight: 600;
    }
    .userinfo .userdetail .line2 {
        font-size: 14px;
        color: #f0ecec;
    }

    .profile-list .item {
        background-color: rgba(255, 255, 255, 0.4);
        border-top: 1px solid rgb(245, 245, 245);
        border-bottom: 1px solid rgb(245, 245, 245);
        line-height: 46px;
        margin-top: 1px;
    font-size: 16px;
    }
    .profile-list .t {
        float: left;
        padding-left: 10px;
    }
    .profile-list .v {
        float: right;
        text-align: right;
        padding-right: 10px;
    }
</style>

<script>
    $("#center-top .home").hide();
    $("#center-top .back").show();
    $("#center-top .menu").hide();
    
    ME.cb = function() {
        fillUserInfo();
    }
    ME.query();
    function fillUserInfo() {
        if (context.user) {
            $(".userinfo .name").html(context.user.user.mobile || '游客');
            $(".userinfo .line2 .red").html(" " + (context.user.balance / 100).toFixed(2) + " ");

            $(".profile-list .uid").html(context.user.user.mobile || '游客');
            $(".profile-list .realname").html(context.user.user.name || '未设置');
        }
    }
    fillUserInfo();

    $(".userinfo .line2 img").click(function() {
        startSpin();
        ME.query(function() {
            stopSpin();
        });
    })

    $(".btn-save").click(function() {
        startLoading();
        var data = {
            qq: $(".qq input").val().trim(),
            wechat: $(".wechat input").val().trim(),
            phone: $(".phone input").val().trim(),
        };
        if ($(".realname input").val()) {
            data.name = $(".realname input").val();
        }
        CMD.modify_user_info(null, data, function() {
            stopLoading();
            alert2("信息修改完成！");
        });
    });
</script>